Results 1 to 3 of 3

Thread: Combining QPainter and WinAPI drawing

  1. #1
    Join Date
    Dec 2009
    Location
    Kiev, Ukraine
    Posts
    16
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question Combining QPainter and WinAPI drawing

    I need to print some document which constist of table (in html) and pdf.
    I have realization which worked in qt3 but some problems in qt4:
    Table draws by QPainter and QTextDocument.
    And then i receive HDC from QPainter "painter->paintEngine()->getDC()" and draw other stuff by WinAPI functions: some needed lines by MoveToEx and LineTo; converting pdf to eps and sending it data using ExtEscape function.
    If i QPainter.begin() before drawing table and end() it after drawing table that tables draws OK and sent to Printer but WinAPI drawing falls.
    And if i end() it after drawing WinAPI lines and pdf i can't see table which QPainter should draw. First time i think that postscript routine block other drawing at all but MoveToEx and LineTo drawn before "Initial" and "End" blocks of postsript sent to printer and i see resulting lines of this functions.

    Help me please solve this trouble

  2. #2
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Combining QPainter and WinAPI drawing

    Why you mix QPainter and WinAPI?

    With QPainter you ca draw lines (QPainter::drawLine) and print on PDF and PS files using QPrinter::OutputFormat-enum
    Last edited by mcosta; 6th July 2011 at 12:02. Reason: updated contents
    A camel can go 14 days without drink,
    I can't!!!

  3. #3
    Join Date
    Dec 2009
    Location
    Kiev, Ukraine
    Posts
    16
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Combining QPainter and WinAPI drawing

    If you mean that i need to use QPrinter to print my html table in PS file and then use it with my PS file (that i receive from PDF converting). I do it but it needs good PS language knowledge to solve problems and combine two finilized PS documents.


    Quote Originally Posted by mcosta View Post
    Why you mix QPainter and WinAPI?
    I use QPainter because it is very convenient to draw HTML with it and i use WinAPI because only it can send my EPS file to printer

Similar Threads

  1. QPainter immediate drawing outside paint event
    By sfcheng77 in forum Qt Programming
    Replies: 1
    Last Post: 23rd February 2011, 06:39
  2. Text drawing with QPainter
    By Rambobino in forum Qt Programming
    Replies: 2
    Last Post: 1st November 2010, 17:26
  3. Drawing a QPixmap transparently with QPainter
    By ComServant in forum Newbie
    Replies: 2
    Last Post: 11th October 2010, 23:10
  4. QPainter and complex drawing : advices
    By toutarrive in forum Qt Programming
    Replies: 0
    Last Post: 18th November 2009, 10:51
  5. Replies: 4
    Last Post: 14th April 2008, 16:39

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.